﻿namespace YunQue.Common.Extensions
{
    /// <summary>
    /// list 扩展
    /// </summary>
    public static class ListExtensions
    {
        /// <summary>
        /// 判断List是否为空或者null
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public static bool IsNullOrEmpty<T>(this List<T> list)
        {
            if (list != null)
            {
                return list.Count == 0;
            }
            return true;
        }
        /// <summary>
        /// 判断List是否不为空或者null
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        /// <returns></returns>
        public static bool IsNotNullOrEmpty<T>(this List<T> list)
        {
            return !list.IsNullOrEmpty();
        }

    }
}
